/*
 *  Copyright 2020-2025 the original author or authors.
 *  You cannot use this file unless authorized by the author.
 */

package org.ipig.model;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.Data;
import lombok.ToString;
import org.ipig.constants.DbmsOperators;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * JoinCollConf
 *
 * @author <a href="mailto:comchnts@163.com">chinats</a>
 * @version $$Id$$
 * @since 1.0
 */
@Data
@ToString
public class JoinCollConf implements Serializable {
    //唯一编码[缓存时使用]
    private String code;
    //功能说明
    private String title;
    //查询语句[支持动态MQL]
    private String queryLanguage;
    //查询语句中的参数字段【多个用逗号隔开，有序】
    private String paramFields = "";
    //获取的字段多个用逗号分隔
    private String fetchFields = "";
    //【对外暴露】值映射字段，多个以逗号隔开【与fetchFields一一对应映射】，有序
    private String mapingFields;
    //连接类型：支持inner(内连接）【默认1:1】-用于业务关联、rigth(右连接1:[1~n]）-用于业务关联、left(左连接1:[0|1])-用于参数关联
    private String joinType = DbmsOperators.JoinType.INNER.code;
    //连接器Conf
    @JSONField(serialize = false, deserialize = false)
    private ConnectorConf connectorConf;
    private String connectorCode;

    //cache时间，默认值为0,值为0意味着元素可以闲置至无限长时间
    private int cacheSeconds = 0;
    //缓存连接器类型
    private String cacheConnType;
    //cache开关：true为开启，其它为关闭，默认为关闭
    private Boolean cacheEnable = Boolean.valueOf(false);
    //调试标识 默认关闭
    private Boolean debugEnable = Boolean.valueOf(false);
    // 其它属性
    private Map<String, String> props = new HashMap<String, String>();
}
